package com.fansl.koala.quickdev.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author fansl
 * @Description: 邮件消息类型
 * @date 2020/3/18 17:10
 */
@Getter
@AllArgsConstructor
public enum EmailMessageTypeEnum {
    /**
     * 通用
     */
    COMMON(0,""),
    /**
     * 注册
     */
    REGISTER(1,"注册"),
    /**
     * 账号激活
     */
    ACCOUNT_ACTIVATION(2,"账号激活"),
    ;

    /**
     * 类型
     */
    private final int code;
    /**
     * 描述
     */
    private final String description;

    public static EmailMessageTypeEnum getByCode(int code){
        for (EmailMessageTypeEnum value:EmailMessageTypeEnum.values()){
            if(value.getCode()==code){
                return value;
            }
        }
        return COMMON;
    }
}
